package com.ald.crossex.dto.wechat;


import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by lishijiong on 15/2/5.
 */
public class PublishDeliveryRequest extends BaseRequest {

    private SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

    /**
     * 用户id
     */
    private Integer uid;
    /**
     * 取货时间
     */
    private String pickUpTime;
    private Date pickUpDateTime;
    /**
     * 物品名称
     */
    private String name;
    /**
     * 物品类型
     */
    private Integer type;
    /**
     * 物品重量
     */
    private float weight;
    /**
     * 物品价值
     */
    private float price;
    /**
     * 配送价格，由系统计算
     */
    private float deliveryPrice;
    /**
     * 预计配送时间
     */
    private float deliveryTime;
    /**
     * 额外加价，用户加价
     */
    private float addPrice;
    /**
     * 发货地址
     */
    private String sendPlace;
    /**
     * 收货地址
     */
    private String receivePlace;
    /**
     * 发货人电话
     */
    private String sendPhone;
    /**
     * 收货人电话
     */
    private String receivePhone;
    /**
     * 发货人姓名
     */
    private String sender;
    /**
     * 收货人姓名
     */
    private String receiver;
    /**
     * 发货人身份证
     */
    private String idCard;

    private String remark;

    public Integer getUid() {
        return uid;
    }

    public void setUid(Integer uid) {
        this.uid = uid;
    }

    public String getPickUpTime() {
        return pickUpTime;
    }

    public void setPickUpTime(String pickUpTime) {
        this.pickUpTime = pickUpTime;
    }

    public Date getPickUpDateTime() {

        String[] s = pickUpTime.split("T");
        //2015-02-27T12:00
        String d = s[0]+" "+s[1]+":00";
        try {
            Date date = format.parse(d);
            return date;
        } catch (ParseException e) {
            e.printStackTrace();
            return new Date();
        }

    }

    public void setPickUpDateTime(Date pickUpDateTime) {
        this.pickUpDateTime = pickUpDateTime;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public float getWeight() {
        return weight;
    }

    public void setWeight(float weight) {
        this.weight = weight;
    }

    public float getPrice() {
        return price;
    }

    public void setPrice(float price) {
        this.price = price;
    }

    public float getDeliveryPrice() {
        return deliveryPrice;
    }

    public void setDeliveryPrice(float deliveryPrice) {
        this.deliveryPrice = deliveryPrice;
    }

    public float getAddPrice() {
        return addPrice;
    }

    public void setAddPrice(float addPrice) {
        this.addPrice = addPrice;
    }

    public String getSendPlace() {
        return sendPlace;
    }

    public void setSendPlace(String sendPlace) {
        this.sendPlace = sendPlace;
    }

    public String getReceivePlace() {
        return receivePlace;
    }

    public void setReceivePlace(String receivePlace) {
        this.receivePlace = receivePlace;
    }

    public String getSendPhone() {
        return sendPhone;
    }

    public void setSendPhone(String sendPhone) {
        this.sendPhone = sendPhone;
    }

    public String getReceivePhone() {
        return receivePhone;
    }

    public void setReceivePhone(String receivePhone) {
        this.receivePhone = receivePhone;
    }

    public String getSender() {
        return sender;
    }

    public void setSender(String sender) {
        this.sender = sender;
    }

    public String getReceiver() {
        return receiver;
    }

    public void setReceiver(String receiver) {
        this.receiver = receiver;
    }

    public String getIdCard() {
        return idCard;
    }

    public void setIdCard(String idCard) {
        this.idCard = idCard;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public float getDeliveryTime() {
        return deliveryTime;
    }

    public void setDeliveryTime(float deliveryTime) {
        this.deliveryTime = deliveryTime;
    }
}
